USERNAME_NOT_EXISTS = 100
USERNAME_ILLEGAL = 101
USERNAME_ALREADY_EXISTS = 102
NO_USERNAME = 103

PASSWORD_ERROR = 110
PASSWORD_ILLEGAL = 111
PASSWORD_NOT_SAME = 112

COURSE_ALREADY_EXISTS = 121
COURSE_NOT_EXISTS = 122

NO_NEWS_EXISTS = 131

NO_HOMEWORK_EXISTS = 141
HOMEWORK_HAS_ALREADY_CLOSED = 142

NO_ANSWER_EXISTS = 151

NO_QUESTION_EXISTS = 161

NO_EXAM_EXISTS = 171

NO_PAPER_EXISTS = 181

NO_USER_SUBMITS_EXISTS = 191

REGISTER_ERROR = 501
ADD_ERROR = 502
ILLEGAL_FILE_FORMAT = 503
UPDATE_ERROR = 504
DATA_ERROR = 505
NO_DATA_FOUND = 506
INSUFFICIENT_USER_PERMISSION = 507
DELETE_ERROR = 508
SEARCH_ERROR = 509
NEED_UNLOCK_SECRET = 510
NO_UNLOCK_SECRET_NEED = 511
UNLOCK_SECRET_ERROR = 512
SEARCH_ERROR = 513

code_to_msg = {
    100: "Username Doesn't Exists",
    101: "Username Illegal",
    102: "Username Already Exists",
    103: "No Username",
    110: "Password Error",
    111: "Password Illegal",
    112: "Password Not Same",
    121: "Course Already Exists",
    122: "Course Not Exists",
    131: "No News Exists",
    141: "No Homework Exists",
    142: "Homework Has Already Closed",
    151: "No Answer Exists",
    161: "No Question Exists",
    171: "No Exam Exists",
    181: "No Paper Exists",
    191: "No User Submits Exists",
    501: "Register Error",
    502: "Add Error",
    503: "Illegal File Format",
    504: "Update Error",
    505: "Data Error",
    506: "No Data Found",
    507: "Insufficient User Permissions",
    508: "Delete Error",
    509: "Search Error",
    510: "Need Unlock Secret",
    511: "No Unlock Secret Need",
    512: "Unlock Secret Error",
    513: "Search Error"
}
